package com.example.demo.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class CheckLogin {
    public static boolean checkLogin(HttpServletRequest request){
        HttpSession session=request.getSession();
        Object userid = session.getAttribute("userid");
        if (userid==null)
            return false;
        return true;
    }

    public static boolean checkPermission(HttpServletRequest request){
        HttpSession session=request.getSession();
        String  tname = (String) session.getAttribute("tname");
        if (tname.equals("超级管理员"))
            return true;
        return false;
    }
}
